package org.jivesoftware.smackx.snyc.packet;

import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.util.XmlStringBuilder;

public class UnsubscribedRosterElement implements ExtensionElement {

	public static final String NAMESPACE = "fc:msg:roster";

    public static final String ELEMENT = "unsubscribed";
	
    private String name = null;
	private String type = null;

	private RosterItem item = null;

	@Override
	public String getElementName() {
		return ELEMENT;
	}

	@Override
	public String getNamespace() {
		return NAMESPACE;
	}

	@Override
	public CharSequence toXML() {
        XmlStringBuilder xml = new XmlStringBuilder(this);
		xml.optAttribute("name", name);
		xml.optAttribute("type", type);

		xml.rightAngleBracket();

		xml.append(item.toXML());
        xml.closeElement(this);
        
        return xml;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public RosterItem getItem() {
		return item;
	}

	public void setItem(RosterItem item) {
		this.item = item;
	}
}
